import React, { Component } from 'react'

export default class App extends Component {
    a = 100
    zaneref = React.createRef()
    render() {

        return (
            <div>
                {/* <input ref="zanetext"/> */}
                <input ref={this.zaneref}/>
                {/* <input ref="zanetext0"/>
                <input ref="zanetext1"/> */}
                <button onClick={() => {
                    // console.log("click1", this.refs.zanetext.value)

                    console.log("click", this.zaneref.current.value) // 拿到原生DOM节点后.value
                } }>add1</button>
            </div>
        )
    }
}

var obj1 = {
    name:"obj1",
    getName(){
        console.log(this.name)
    }
}

var obj2 = {
    name:"obj2",
    getName(){
        console.log(this.name)
    }
}
obj1.getName.bind(obj2)()

